home *** CD-ROM | disk | FTP | other *** search
/ NCSoft Asset Disc (USA) / NCSoft Asset Disc (USA).bin / coh.swf / scripts / DefineSprite_381 / frame_88 / DoAction.as
Encoding:
Text File  |  2003-05-03  |  992 b   |  42 lines

  1. function moveFrame()
  2. {
  3.    linewidth = mc_line._width - scroll._width;
  4.    currentDistance = scroll._x - mc_line._x - scroll._width / 2;
  5.    x = Math.round(currentDistance * mc_mov._totalframes / linewidth);
  6.    this.mc_mov.gotoAndStop(x);
  7. }
  8. function moveScroll()
  9. {
  10.    linewidth = mc_line._width - scroll._width;
  11.    currentDistance = scroll._x - mc_line._x - scroll._width / 2;
  12.    x = Math.round(linewidth * mc_mov._currentframe / mc_mov._totalframes);
  13.    scroll._x = mc_line._x + scroll._width / 2 + x;
  14. }
  15. function controlMovie(mousePress)
  16. {
  17.    if(mousePress)
  18.    {
  19.       this.onEnterFrame = function()
  20.       {
  21.          moveFrame();
  22.          mc_mov.stop();
  23.       };
  24.    }
  25.    else
  26.    {
  27.       this.onEnterFrame = function()
  28.       {
  29.          movescroll();
  30.       };
  31.       mc_play.gotoAndStop(2);
  32.       mc_mov.play();
  33.    }
  34. }
  35. if(!this.checkMovie)
  36. {
  37.    loadMovie("mov/CityOfHeroes_movie_trailer.swf","mc_mov");
  38.    this.checkMovie = true;
  39. }
  40. controlMovie();
  41. stop();
  42.